// McIncomingProxyHandler.h: interface for the McIncomingProxyHandler class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MCINCOMINGPROXYHANDLER_H__3C22D25C_57BC_4ABB_84BB_62F4D7CBFF5D__INCLUDED_)
#define AFX_MCINCOMINGPROXYHANDLER_H__3C22D25C_57BC_4ABB_84BB_62F4D7CBFF5D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "..\McAsyncSocket.h"
class McIncomingProxyHandler : public McAsyncSocketHandler
{
	virtual int after_open();
	virtual int after_read_frame(const char* data, long length);
	long netid_;
	set<long> module_id_set_;
public:
	McIncomingProxyHandler();
	virtual ~McIncomingProxyHandler();
	bool have_other_module(long module_id);
	bool have_module_with_addr(const MsAddr& addr);
	long get_netid();
	long get_remote_net_module_id();
	bool have_module(long module_id);
};
class McIncomingProxyAcceptor : public ACE_Asynch_Acceptor<McIncomingProxyHandler>
{
public:
	void close (void);
	set<McIncomingProxyHandler*> incoming_handlers_;
};
typedef ACE_Unmanaged_Singleton<McIncomingProxyAcceptor, ACE_Null_Mutex> INCOMING_PROXY_ACCEPTOR;


#endif // !defined(AFX_MCINCOMINGPROXYHANDLER_H__3C22D25C_57BC_4ABB_84BB_62F4D7CBFF5D__INCLUDED_)
